package com.java.userservice.controller;

import com.java.common.model.Result;
import com.java.userservice.dao.PermissionMapper;
import com.java.userservice.model.Permission;
import com.java.userservice.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("permission")
public class PermissionController {

    @Autowired
    private PermissionService permissionService;

    @PostMapping("/list")
    public Result list(@RequestBody Permission permission) {
        return permissionService.list(permission);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Permission permission) {
        return permissionService.save(permission);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Permission permission) {
        return permissionService.modify(permission);
    }

    @GetMapping("/remove")
    public Result remove(int[] ids) {
        return permissionService.remove(ids);
    }
}
